Howdy,
I am seeing some strange behavior in Kmotion CNC. I wrote a user program M105 to take the X axis to a safe position, (execute/wait see below). When I run the program it moves X to where I would like. So far so good. Then I try to run the M105 in a G-Code program.
M105
G00 Y10
M30
The M105 moves to the correct X coordinate (-0.25), and Y moves. Now I manually jog the X axis to 5", and run the g code again. X moves to the correct position (-0.25), but when the G-code hits M30 it rewrites the X position back to where it started (5"). So I hit cycle start to run the g-code again. The control thinks the position is at 5" so it moves -5.25". This is way out of position. I dont have any program attached to M30.
This is very strange. Sometimes everything works, and other times it does what I described above. Why would KMotionCNC not always track the position commanded in the C program? When I look at "Machine Coordinates" it seems that the position is okay there.
Any suggestions??
#include "KMotionDef.h"
#define stpIN 1910
main()
{
Move(5,((-25.9672-.25)*stpIN)) ;
while (!CheckDone(5)) ; // loop until motion completes
}